package com.interview.controller;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by fangjicai on 2020/4/20.
 */

@RestController
@RefreshScope //支持动态刷新
public class ConfigRefreshController {
    @Value("${env}") //在git中配置的key
    private String env;

    @GetMapping("/getData")
    public String getData(){

        return "获取git配置："+env;
    }
}
